﻿
using Jayden.Dll.Core.Exceptions;
namespace Jayden.Dll.Web.Styles
{
	public class CssProperty
	{
		private string m_Name;
		private string m_Value;

		public CssProperty(string name, string value)
		{
			m_Name = name;
			m_Value = value;
		}

		public string Name { get { return m_Name; } }
		public string Value { get { return m_Value; } set { m_Value = value; } }

		public override string ToString() { return string.Format("{0}:{1};", m_Name, m_Value); }

		public int CheckValidity()
		{
			int version = CssPropertyDescription.GetVersion(m_Name);
			if (version == -1)
				throw new Exception("'{0}' is an invalid css property name.", m_Name);
			return version;
		}
	}
}
